global keepers2002 ""


numlabel, add

drop if v5~=3

genl yr=2002
global keepers2002 $keepers2002 yr

genl id=v4
global keepers2002 $keepers2002 id

genl income3=v598
recode income3 1 2 = 0 3 = 1 4 5 = 2 .=.
global keepers2002 $keepers2002 income3

genl pid_ce=(v236==2 & v237==1)
replace pid_ce=. if v235==.
global keepers2002 $keepers2002 pid_ce

gen pid_gov=pid_ce
global keepers2002 $keepers2002 pid_gov

genl vote_ce=v303
recode vote_ce 2=1 .=. else=0
global keepers2002 $keepers2002 vote_ce

genl vote_gov=vote_ce
global keepers2002 $keepers2002 vote_gov


genl gpi=v23
recode gpi 8=2.5
replace gpi=abs(gpi-4)/3
global keepers2002 $keepers2002 gpi

genl socref=v215
recode socref 8=2.5
replace socref=abs(socref-4)/3
global keepers2002 $keepers2002 socref

genl degree=v500
recode degree 1/7 88=0 8/9=1 
global keepers2002 $keepers2002 degree


// Class/occupation

gen class_reho_3cat_strata = v595
recode class_reho_3cat_strata 1=1 2=1 3=2 4=2 5=1 6=2 7=2 8=.
replace class_reho_3cat_strata = . if class_reho_3cat_strata > 40
label variable class_reho_3cat_strata "Social class (3 cats.): higher value is higher class"
*label define LblClassGrade 1 "A: (Higher man.; prof." 2 "B: Lower man.; admin." 3 "C1A: Skilled; supervis. non-manu." 4 "C1B: Lower non-manu." 5 "C2: Skilled manu." 6 "D: Unskilled manu."
*label values class_head_grade LblClassGrade
global keepers2002 $keepers2002 class_reho_3cat_strata

gen male = v12
recode male 1=1 2=0
global keepers2002 $keepers2002 male

gen married = v510
recode married 1=1 2/4=0 5=0 8=.
global keepers2002 $keepers2002 married

gen unionmem_resp = v501
recode unionmem_resp 1=1 5=0 8=.
global keepers2002 $keepers2002 unionmem_resp

*gen unionmem_spou = v259
*recode unionmem_spou 1/4=1 .=0
*global keepers1979 $keepers1979 unionmem_spou



// Pascal/SM moderators


gen party_ID=. 
   replace party_ID=1 if  v235==1 & v236==1
   replace party_ID=2 if  v235==1 & v236==2
   replace party_ID=3 if  v235==1 & v236==3
   replace party_ID=4 if  v235==1 & v236==4
   replace party_ID=10 if  v235==1 & v236==5
   replace party_ID=6 if  v235==1 & v236==6
   replace party_ID=18 if  v235==1 & v236==7
   replace party_ID=19 if  v235==1 & v236==8
   replace party_ID=7 if  v235==1 & v236==9
   replace party_ID=8 if  v235==1 & v236==88



 lab def party_ID 1 "v�nsterpartiet kom " 2 "socialdemokraterna" 3"centerpartiet" 4"folkpartiet" 5"h�gerpartiet" 6"kristen demokratis" 7 "other" 8 "will not answer"9 " kommunistiska f�rbundet marxist-len" 10 " moderata samlingspartiet " 11 "sveriges kommunis" 12 "borgerligt "  13 "FC+C" 14 "lokal borgerlig" 15 "sk�nepartiet" 16 "kommunistiska arbetaref�rbundet" 17 "vpk, apk, kpmlr, skp, kaf" 18 "gr�nt parti" 19 "ny demokrati"
 lab val party_ID party_ID
  tab party_ID, m
 tab party_ID v236, m



foreach var of varlist  v147 v149 v150 v152 v153 v154 v155{
        gen Z`var'=`var'
		replace Z`var'=5 if `var'==1
		replace Z`var'=4 if `var'==2
		replace Z`var'=3 if `var'==8 | `var'==3
		replace Z`var'=2 if `var'==4
		replace Z`var'=1 if `var'==5
		replace Z`var'=(Z`var'-1)/4
		tab Z`var' `var', m
  }

rename Zv147 cut_public
lab var cut_public "1=good idea to reduce size of public sector"

rename Zv149 cut_benefit
lab var cut_benefit "1=good idea to reduce social benefits"

rename Zv150 cut_taxes
lab var cut_taxes "1=good idea to cut taxes"

rename Zv152 privatize 
lab var privatize "1=good idea to sell public companies" 

rename Zv153 reduce_inequalities
lab var reduce_inequalities "1=good idea to reduce income differences" 

rename Zv154 private_health
lab var private_health "1=good idea to increase private run health care"

rename  Zv155 finance_influence
lab var finance_influence "1=good idea to reduce finance influence on politics"


 foreach var of varlist  v214{
        gen Z`var'=`var'
		replace Z`var'=1 if `var'==4
		replace Z`var'=2 if `var'==3
		replace Z`var'=2.5 if `var'==8
		replace Z`var'=3 if `var'==2
		replace Z`var'=4 if `var'==1
            replace Z`var'=. if `var'==6 | `var'==9 
		replace Z`var'=(Z`var'-1)/3
		tab Z`var' `var', m
  }



    rename  Zv214 econ_control
  lab var  econ_control "1=agree state control limit bank and industry influence"


foreach var of varlist   v222 v223 v224{
        gen Z`var'=`var'/10
		replace Z`var'=0.5 if Z`var'>1
		replace Z`var'=. if `var'==.
			tab Z`var' `var', m
  }

rename Zv222 m_market_oriented
lab var m_market_oriented "1=favor move toward more free-market"

rename Zv224 m_growth
lab var m_growth "1=favor move toward towards high rate growth and productivity" 

rename Zv223 m_socialism
lab var m_socialism "1=favor move toward socialism"


gen right=v241/10
replace right=0.50 if right>1 & right~=.
  tab right v241, m
  lab var right "1=far right"


     gen talk_politic=.
 replace talk_politic=1 if  v24==1
 replace talk_politic=0.66 if  v24==2
replace talk_politic=0.33 if  v24==3
replace talk_politic=0 if  v24==4
replace talk_politic=0.5 if  v24==8
 replace talk_politic=. if  v24==6 |  v24==9
 
 tab  v24 talk_politic, m
  lab var talk_politic "1=often talk politic outside and inside family" 


gen newspaper_politics=.
 replace newspaper_politics=1 if v13==1
 replace newspaper_politics=0.66 if v13==2
 replace newspaper_politics=0.33 if v13==3
 replace newspaper_politics=0 if v13==4
  replace newspaper_politics=0.5 if v13==8
tab newspaper_politics v13,m
 lab var newspaper_politics "1=read more politic articles"


	gen imp_winner=.
 replace imp_winner=1 if v26==1
 replace imp_winner=0.5 if v26==3 | v26==8
 replace imp_winner=0 if v26==2
 tab v26 imp_winner, m
 lab var imp_winner "1=which party win the election is important"

 
 
 
gen anti_m_socialism=.
replace anti_m_socialism=0 if m_socialism==1
replace anti_m_socialism=0.1 if m_socialism>=0.88 & m_socialism<=0.91 
replace anti_m_socialism=0.2 if m_socialism>=0.78 & m_socialism<=0.81 
replace anti_m_socialism=0.3 if m_socialism>=0.68 & m_socialism<=0.71 
replace anti_m_socialism=0.4 if m_socialism>=0.58 & m_socialism<=0.61 
replace anti_m_socialism=0.5 if m_socialism>=0.48 & m_socialism<=0.51 
replace anti_m_socialism=0.6 if m_socialism>=0.38 & m_socialism<=0.41 
replace anti_m_socialism=0.7 if m_socialism>=0.28 & m_socialism<=0.31 
replace anti_m_socialism=0.8 if m_socialism>=0.18 & m_socialism<=0.21 
replace anti_m_socialism=0.9 if m_socialism>=0.08 & m_socialism<=0.11 
replace anti_m_socialism=1 if m_socialism==0
tab anti_m_socialism m_socialism, m

gen index_interest=(gpi+talk_politic+newspaper_politics)/3
global keepers2002 $keepers2002 index_interest

gen index_market_oriented=( socref+ cut_public+ cut_benefit+ cut_taxes+ privatize + private_health+ m_market_oriented+ anti_m_socialism  )/8
global keepers2002 $keepers2002 index_market_oriented
